{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "%load_ext autoreload\n",
    "%autoreload 2\n",
    "import sys\n",
    "sys.path.append(\"/home/xuhao/d2slam_ws/src/swarm_msgs/swarm_msgs/scripts\")\n",
    "from DistributedPGOData_t import *\n",
    "from Time_t import *\n",
    "from DistributedVinsData_t import *\n",
    "from Pose_t import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = DistributedPGOData_t()\n",
    "buf = data.encode()\n",
    "print(len(buf))\n",
    "data.frame_poses.append(Pose_t())\n",
    "data.frame_ids.append(0)\n",
    "data.frame_poses_num = 1\n",
    "vec = Vector_t()\n",
    "vec.data = [0.0 for i in range(6)]\n",
    "vec.size = 6\n",
    "data.frame_duals.append(vec)\n",
    "data.frame_dual_num = 1\n",
    "data.frame_num = 1\n",
    "data.frame_ids.append(0)\n",
    "buf = data.encode()\n",
    "print(len(buf))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = DistributedVinsData_t()\n",
    "for i in range(4):\n",
    "    data.extrinsic.append(Pose_t())\n",
    "    data.cam_ids.append(0)\n",
    "data.camera_num = 4\n",
    "buf = data.encode()\n",
    "print(len(buf))\n",
    "\n",
    "data.frame_poses.append(Pose_t())\n",
    "data.frame_ids.append(0)\n",
    "data.sld_win_len = 1\n",
    "buf = data.encode()\n",
    "print(len(buf))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "08ce52785f0fedc81003ce387e097a83d6cc9494681cd746006386992005bb71"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
